/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package javaapplication1;



import java.io.FileNotFoundException;
import java.io.IOException;



/**
 *
 * @author new
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws FileNotFoundException, IOException {
        // TODO code application logic here

        FileFormatHandler ffh = new FileFormatHandler();
        String fileName = ffh.asmToRes(args[0]);

        IncludeHandler ih = new IncludeHandler();
        ih.handleInclude(fileName);
        System.gc();

        CommentHandler ch = new CommentHandler();
        ch.deleteComment(fileName);


        QuotationHandler qh = new QuotationHandler();
        qh.changeQuote(fileName);

        ffh.toUpperCase(fileName);

        LabelHandler lh = new LabelHandler();
        lh.getSegmentTable(fileName);
        lh.delSegment(fileName);
        lh.getLabelTable(fileName);


        PubExtHandler peh = new PubExtHandler();
        peh.delPubExt(fileName);


        EquHandler eh = new EquHandler();
        eh.getEquTable(fileName);
        eh.equReplace(fileName);


        lh.rsegToEnd(fileName);


        DSHandler dsh = new DSHandler();
        dsh.changeToNOP(fileName);

        DBHandler dbh = new DBHandler();
        dbh.changeDB(fileName);

        Reallocation reallocation = new Reallocation();
        reallocation.reallocate(fileName);

        Assembler assembler = new Assembler();
        assembler.assemble(fileName);
    }
}